<!DOCTYPE html>
<html lang="zh-CN" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>一些组件 | VitePress基础框架</title>
    <meta name="description" content="VitePress基础框架的站点描述">
    <meta name="generator" content="VitePress v1.3.4">
    <link rel="preload stylesheet" href="/vitepress-template-public/assets/style.Bh2VXVad.css" as="style">
    <script type="module" src="/vitepress-template-public/assets/chunks/metadata.6b2f4039.js"></script>
    <script type="module" src="/vitepress-template-public/assets/app.CtFKj54A.js"></script>
    <link rel="preload" href="/vitepress-template-public/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/theme.CHXT_227.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/framework.BCtciejH.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/index.DLKixYZx.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/guide_plugin_util.md.CrbaoIFv.lean.js">
    <link rel="icon" type="image/svg+xml" href="/vitepress-template-public/logo/vitepress-logo-mini.svg">
    <link rel="icon" type="image/png" href="/vitepress-template-public/logo/vitepress-logo-mini.png">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-e7ae3156><!--[--><!--]--><!--[--><span tabindex="-1" data-v-b6dc82ed></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-b6dc82ed> Skip to content </a><!--]--><!----><header class="VPNav" data-v-e7ae3156 data-v-dd74d679><div class="VPNavBar" data-v-dd74d679 data-v-f294b04e><div class="wrapper" data-v-f294b04e><div class="container" data-v-f294b04e><div class="title" data-v-f294b04e><div class="VPNavBarTitle has-sidebar" data-v-f294b04e data-v-612ad8f1><a class="title" href="/vitepress-template-public/" data-v-612ad8f1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/vitepress-template-public/logo/vitepress-logo-mini.svg" width="24" height="24" alt data-v-50300c68><!--]--><span data-v-612ad8f1>VitePress基础框架</span><!--[--><!--]--></a></div></div><div class="content" data-v-f294b04e><div class="content-body" data-v-f294b04e><!--[--><!--]--><div class="VPNavBarSearch search" data-v-f294b04e><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="搜索文档"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">搜索文档</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-f294b04e data-v-fa8254e6><span id="main-nav-aria-label" class="visually-hidden" data-v-fa8254e6> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/vitepress-template-public/guide/install" tabindex="0" data-v-fa8254e6 data-v-8b7bfc54><!--[--><span data-v-8b7bfc54>教程</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vitepress-template-public/examples/markdown" tabindex="0" data-v-fa8254e6 data-v-8b7bfc54><!--[--><span data-v-8b7bfc54>示例</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-fa8254e6 data-v-e261b7a7><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-e261b7a7><span class="text" data-v-e261b7a7><!----><span data-v-e261b7a7>下拉导航</span><span class="vpi-chevron-down text-icon" data-v-e261b7a7></span></span></button><div class="menu" data-v-e261b7a7><div class="VPMenu" data-v-e261b7a7 data-v-0430342e><div class="items" data-v-0430342e><!--[--><!--[--><div class="VPMenuGroup" data-v-0430342e data-v-11db401e><p class="title" data-v-11db401e>下拉导航标题</p><!--[--><!--[--><div class="VPMenuLink" data-v-11db401e data-v-3da97ee6><a class="VPLink link vp-external-link-icon" href="https://github.com/dcdy/vitepress-template/edit/main/docs/.vitepress/config.mts" target="_blank" rel="noreferrer" data-v-3da97ee6><!--[-->子项A<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-11db401e data-v-3da97ee6><a class="VPLink link vp-external-link-icon" href="https://gitee.com/xia_mei_ting/vitepress-template/blob/main/docs/.vitepress/config.mts" target="_blank" rel="noreferrer" data-v-3da97ee6><!--[-->子项B<!--]--></a></div><!--]--><!--]--></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-fa8254e6 data-v-e261b7a7><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-e261b7a7><span class="text" data-v-e261b7a7><!----><span data-v-e261b7a7>设置</span><span class="vpi-chevron-down text-icon" data-v-e261b7a7></span></span></button><div class="menu" data-v-e261b7a7><div class="VPMenu" data-v-e261b7a7 data-v-0430342e><div class="items" data-v-0430342e><!--[--><!--[--><!----><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-f294b04e data-v-cfa3e56c><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-cfa3e56c data-v-534bc2ea data-v-48850b97><span class="check" data-v-48850b97><span class="icon" data-v-48850b97><!--[--><span class="vpi-sun sun" data-v-534bc2ea></span><span class="vpi-moon moon" data-v-534bc2ea></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-f294b04e data-v-dcbce86c data-v-46044fd4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/dcdy/vitepress-template" aria-label="github" target="_blank" rel="noopener" data-v-46044fd4 data-v-add20255><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://gitee.com/xia_mei_ting/vitepress-template" aria-label target="_blank" rel="noopener" data-v-46044fd4 data-v-add20255><svg t="1727428813465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2268" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2269"></path></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-f294b04e data-v-be29ddb3 data-v-e261b7a7><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-e261b7a7><span class="vpi-more-horizontal icon" data-v-e261b7a7></span></button><div class="menu" data-v-e261b7a7><div class="VPMenu" data-v-e261b7a7 data-v-0430342e><!----><!--[--><!--[--><!----><div class="group" data-v-be29ddb3><div class="item appearance" data-v-be29ddb3><p class="label" data-v-be29ddb3>主题</p><div class="appearance-action" data-v-be29ddb3><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-be29ddb3 data-v-534bc2ea data-v-48850b97><span class="check" data-v-48850b97><span class="icon" data-v-48850b97><!--[--><span class="vpi-sun sun" data-v-534bc2ea></span><span class="vpi-moon moon" data-v-534bc2ea></span><!--]--></span></span></button></div></div></div><div class="group" data-v-be29ddb3><div class="item social-links" data-v-be29ddb3><div class="VPSocialLinks social-links-list" data-v-be29ddb3 data-v-46044fd4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/dcdy/vitepress-template" aria-label="github" target="_blank" rel="noopener" data-v-46044fd4 data-v-add20255><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://gitee.com/xia_mei_ting/vitepress-template" aria-label target="_blank" rel="noopener" data-v-46044fd4 data-v-add20255><svg t="1727428813465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2268" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2269"></path></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-f294b04e data-v-63d80599><span class="container" data-v-63d80599><span class="top" data-v-63d80599></span><span class="middle" data-v-63d80599></span><span class="bottom" data-v-63d80599></span></span></button></div></div></div></div><div class="divider" data-v-f294b04e><div class="divider-line" data-v-f294b04e></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-e7ae3156 data-v-3a585b62><div class="container" data-v-3a585b62><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-3a585b62><span class="vpi-align-left menu-icon" data-v-3a585b62></span><span class="menu-text" data-v-3a585b62>菜单</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-3a585b62 data-v-d6887fce><button data-v-d6887fce>回到顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-e7ae3156 data-v-dbec4220><div class="curtain" data-v-dbec4220></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-dbec4220><span class="visually-hidden" id="sidebar-aria-label" data-v-dbec4220> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-3fb65e2d><section class="VPSidebarItem level-0 collapsible" data-v-3fb65e2d data-v-9529bbf6><div class="item" role="button" tabindex="0" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><h2 class="text" data-v-9529bbf6>简介</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9529bbf6><span class="vpi-chevron-right caret-icon" data-v-9529bbf6></span></div></div><div class="items" data-v-9529bbf6><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/install" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>安装</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible" data-v-9529bbf6 data-v-9529bbf6><div class="item" role="button" tabindex="0" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><h3 class="text" data-v-9529bbf6>配置</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9529bbf6><span class="vpi-chevron-right caret-icon" data-v-9529bbf6></span></div></div><div class="items" data-v-9529bbf6><!--[--><div class="VPSidebarItem level-2 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-home" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>首页配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-doc" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>文档配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-other" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>其他配置</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/layout-slot" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>布局插槽</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-3fb65e2d><section class="VPSidebarItem level-0 collapsible has-active" data-v-3fb65e2d data-v-9529bbf6><div class="item" role="button" tabindex="0" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><h2 class="text" data-v-9529bbf6>插件</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9529bbf6><span class="vpi-chevron-right caret-icon" data-v-9529bbf6></span></div></div><div class="items" data-v-9529bbf6><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/plugin/image" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>图片</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/plugin/code" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>代码块</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/plugin/style" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>样式美化</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/plugin/util" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>一些组件</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-3fb65e2d><section class="VPSidebarItem level-0 collapsible" data-v-3fb65e2d data-v-9529bbf6><div class="item" role="button" tabindex="0" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><h2 class="text" data-v-9529bbf6>部署</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9529bbf6><span class="vpi-chevron-right caret-icon" data-v-9529bbf6></span></div></div><div class="items" data-v-9529bbf6><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9529bbf6 data-v-9529bbf6><div class="item" data-v-9529bbf6><div class="indicator" data-v-9529bbf6></div><a class="VPLink link link" href="/vitepress-template-public/guide/github-pages" data-v-9529bbf6><!--[--><p class="text" data-v-9529bbf6>Github Pages</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-e7ae3156 data-v-9d495596><div class="VPDoc has-sidebar has-aside" data-v-9d495596 data-v-09fc73c3><!--[--><!--]--><div class="container" data-v-09fc73c3><div class="aside" data-v-09fc73c3><div class="aside-curtain" data-v-09fc73c3></div><div class="aside-container" data-v-09fc73c3><div class="aside-content" data-v-09fc73c3><div class="VPDocAside" data-v-09fc73c3 data-v-f2095285><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-f2095285 data-v-5ec4093d><div class="content" data-v-5ec4093d><div class="outline-marker" data-v-5ec4093d></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-5ec4093d>页面导航</div><ul class="VPDocOutlineItem root" data-v-5ec4093d data-v-31939393><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-f2095285></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-09fc73c3><div class="content-container" data-v-09fc73c3><!--[--><!--]--><main class="main" data-v-09fc73c3><div style="position:relative;" class="vp-doc _vitepress-template-public_guide_plugin_util external-link-icon-enabled" data-v-09fc73c3><div><h1 id="一些组件" tabindex="-1">一些组件 <a class="header-anchor" href="#一些组件" aria-label="Permalink to &quot;一些组件&quot;">​</a></h1><h2 id="返回顶部" tabindex="-1">返回顶部 <a class="header-anchor" href="#返回顶部" aria-label="Permalink to &quot;返回顶部&quot;">​</a></h2><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241211171336907.png" alt="image-20241211171336907" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p><p>新建<code>docs/.vitepress/theme/components/BackToTop.vue</code> 文件</p><details class="details custom-block"><summary>点击查看<code>BackToTop.vue</code> 文件内容</summary><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="BackToTop.vue">BackToTop.vue</span></div><div class="language-vue vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Transition</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> name</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;fade&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> v-show</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">showBackTop</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vitepress-backTop-main&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> title</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;返回顶部&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> @</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">click</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">scrollToTop</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">300</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">)</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">svg</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				t</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;1720595052079&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;icon&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				viewBox</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;0 0 1024 1024&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				version</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;1.1&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				xmlns</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;http://www.w3.org/2000/svg&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				p-id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;4279&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				width</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;200&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">				height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;200&quot;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">				&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">path</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">					d</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;M752.736 431.063C757.159 140.575 520.41 8.97 504.518 0.41V0l-0.45 0.205-0.41-0.205v0.41c-15.934 8.56-252.723 140.165-248.259 430.653-48.21 31.457-98.713 87.368-90.685 184.074 8.028 96.666 101.007 160.768 136.601 157.287 35.595-3.482 25.232-30.31 25.232-30.31l12.206-50.095s52.47 80.569 69.304 80.528c15.114-1.23 87-0.123 95.6 0h0.82c8.602-0.123 80.486-1.23 95.6 0 16.794 0 69.305-80.528 69.305-80.528l12.165 50.094s-10.322 26.83 25.272 30.31c35.595 3.482 128.574-60.62 136.602-157.286 8.028-96.665-42.475-152.617-90.685-184.074z m-248.669-4.26c-6.758-0.123-94.781-3.359-102.891-107.192 2.95-98.714 95.97-107.438 102.891-107.93 6.964 0.492 99.943 9.216 102.892 107.93-8.11 103.833-96.174 107.07-102.892 107.192z m-52.019 500.531c0 11.838-9.42 21.382-21.012 21.382a21.217 21.217 0 0 1-21.054-21.34V821.74c0-11.797 9.421-21.382 21.054-21.382 11.591 0 21.012 9.585 21.012 21.382v105.635z m77.333 57.222a21.504 21.504 0 0 1-21.34 21.626 21.504 21.504 0 0 1-21.34-21.626V827.474c0-11.96 9.543-21.668 21.299-21.668 11.796 0 21.38 9.708 21.38 21.668v157.082z m71.147-82.043c0 11.796-9.42 21.34-21.053 21.34a21.217 21.217 0 0 1-21.013-21.34v-75.367c0-11.755 9.421-21.299 21.013-21.299 11.632 0 21.053 9.544 21.053 21.3v75.366z&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">					fill</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;#FFF&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">					p-id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;4280&quot;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">				&gt;&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">path</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">svg</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Transition</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> setup</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">onBeforeUnmount</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">onMounted</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">ref</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vue&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 是否显示返回顶部</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> showBackTop</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> ref</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;">false</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">let</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> animationFrameId</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> null</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">; </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 存储 requestAnimationFrame 的 ID</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">function</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> scrollToTop</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">duration</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 500</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	// window.scrollTo({</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	// 	top: 0,</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	// 	behavior: &#39;smooth&#39;,</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	// });</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">	const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> start</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> window</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">scrollY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">	const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> startTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> performance</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">now</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">	function</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> animation</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">currentTime</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">		const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> elapsed</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> currentTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> -</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> startTime</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">		const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> progress</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> Math</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">min</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">elapsed</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> /</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> duration</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">1</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">); </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 计算进度</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">		const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> ease</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 1</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> Math</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">pow</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">1</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> -</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> progress</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">3</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">); </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 缓动函数，调整滚动效果</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">		window</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">scrollTo</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">start</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> *</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">1</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> -</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> ease</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">)); </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 根据进度调整滚动位置</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">		if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">progress</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> &lt;</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 1</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">			animationFrameId</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> requestAnimationFrame</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">animation</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">); </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 继续动画</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	animationFrameId</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> requestAnimationFrame</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">animation</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">); </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 开始动画</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 节流</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">function</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> throttle</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">fn</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">delay</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 50</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">	let</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> lastTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">	return</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;"> function</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">		let</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> nowTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> +</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">new</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> Date</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">();</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">		if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">nowTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> -</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> lastTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> &gt;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> delay</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">			fn</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">apply</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">this</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">arguments</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">			lastTime</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> nowTime</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	};</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> onScroll</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> throttle</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(() </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	showBackTop</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">value</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> Boolean</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">window</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">scrollY</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> &gt;</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 100</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">});</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 监听滚动事件</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">onMounted</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(() </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> window</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">addEventListener</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;scroll&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">onScroll</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">));</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 移除监听事件并取消动画</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">onBeforeUnmount</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(() </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	window</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">removeEventListener</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;scroll&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">onScroll</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">	if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">animationFrameId</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">		cancelAnimationFrame</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">animationFrameId</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">); </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 停止动画</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">});</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> lang</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;css&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> scoped</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.vitepress-backTop-main</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	z-index</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">999</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	position</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">fixed</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	bottom</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	right</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	cursor</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">pointer</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	width</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">50px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">50px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	border-radius</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">50%</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	background-color</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">var</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">--vp-c-indigo-1</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	padding</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">10px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	box-shadow</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">2px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 2px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 10px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 4px</span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;"> rgba</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0.15</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.vitepress-backTop-main:hover</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	opacity</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0.6</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#D7BA7D;">svg</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	width</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">100%</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">100%</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">/* 旋转动画 */</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">@keyframes</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> bounce</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	0% {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		transform</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">translateY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">rotateY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	50% {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		transform</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">translateY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">-10px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">rotateY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">180deg</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	100% {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		transform</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">translateY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">rotateY</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">360deg</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">/* 进入 退出动画 */</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.fade-enter-active</span><span style="--shiki-light:#A626A4;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.fade-leave-active</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	transition</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: opacity </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0.5s</span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;"> ease</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.fade-enter-from</span><span style="--shiki-light:#A626A4;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.fade-leave-to</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	opacity</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br><span class="line-number">110</span><br><span class="line-number">111</span><br><span class="line-number">112</span><br><span class="line-number">113</span><br><span class="line-number">114</span><br><span class="line-number">115</span><br><span class="line-number">116</span><br><span class="line-number">117</span><br><span class="line-number">118</span><br><span class="line-number">119</span><br><span class="line-number">120</span><br><span class="line-number">121</span><br><span class="line-number">122</span><br><span class="line-number">123</span><br><span class="line-number">124</span><br><span class="line-number">125</span><br><span class="line-number">126</span><br><span class="line-number">127</span><br><span class="line-number">128</span><br><span class="line-number">129</span><br></div></div></div></details><p>同级目录<code>CustomLayoutSlot.vue</code>文件内引入<code>BackToTop.vue</code>组件</p><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="CustomLayoutSlot.vue">CustomLayoutSlot.vue</span></div><div class="language-vue vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Layout</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		&lt;!-- ...其他插槽内容 --&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		&lt;!-- TAG返回顶部 --&gt;</span></span>
<span class="line highlighted"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> #</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">doc-footer-before</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line highlighted"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">BackToTop</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;"> /&gt;</span></span>
<span class="line highlighted"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Layout</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> setup</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// ...其他内容</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 返回顶部</span></span>
<span class="line highlighted"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;"> BackToTop</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;./BackToTop.vue&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div></div><h2 id="访问量统计" tabindex="-1">访问量统计 <a class="header-anchor" href="#访问量统计" aria-label="Permalink to &quot;访问量统计&quot;">​</a></h2><h3 id="vercount-计数统计" tabindex="-1">Vercount 计数统计 <a class="header-anchor" href="#vercount-计数统计" aria-label="Permalink to &quot;Vercount 计数统计&quot;">​</a></h3><p>地址：<a href="https://github.com/EvanNotFound/vercount" target="_blank" rel="noreferrer">https://github.com/EvanNotFound/vercount</a></p><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241211171650294.png" alt="image-20241211171650294" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241211171510120.png" alt="image-20241211171510120" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p><h4 id="配置" tabindex="-1">配置 <a class="header-anchor" href="#配置" aria-label="Permalink to &quot;配置&quot;">​</a></h4><p>新建<code>docs/utils/useLoadScript.ts</code>文件</p><details class="details custom-block"><summary>点击查看 <code>useLoadScript.ts</code>文件内容</summary><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="useLoadScript.ts">useLoadScript.ts</span></div><div class="language-ts vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">/**</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> * 加载外部脚本。</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> * </span><span style="--shiki-light:#383A42;--shiki-dark:#569CD6;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">@</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">param</span><span style="--shiki-light:#C18401;--shiki-dark:#4EC9B0;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> {string}</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> url</span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> - 脚本的 URL 地址。</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> * </span><span style="--shiki-light:#383A42;--shiki-dark:#569CD6;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">@</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">param</span><span style="--shiki-light:#C18401;--shiki-dark:#4EC9B0;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> {Object}</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> [props]</span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> - 脚本属性的对象。</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;"> */</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">function</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> useLoadScript</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">url</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">:</span><span style="--shiki-light:#0184BC;--shiki-dark:#4EC9B0;"> string</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">props</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">?:</span><span style="--shiki-light:#C18401;--shiki-dark:#4EC9B0;"> Record</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&lt;</span><span style="--shiki-light:#383A42;--shiki-dark:#4EC9B0;">string</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#383A42;--shiki-dark:#4EC9B0;">string</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&gt;) {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">	if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">querySelector</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">`script[src=&quot;</span><span style="--shiki-light:#CA1243;--shiki-dark:#569CD6;">${</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">url</span><span style="--shiki-light:#CA1243;--shiki-dark:#569CD6;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;]`</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">)) {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">		return</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">; </span><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 脚本已加载</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">	const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> script</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">createElement</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;script&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	script</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">defer</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> true</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	script</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">async</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> true</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	script</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">src</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> url</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	// 将 props 对象中的属性添加到 script 元素上</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">	if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">props</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">		Object</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">entries</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">props</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">).</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">forEach</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(([</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">key</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">value</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">]) </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">			script</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">setAttribute</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">key</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">value</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		});</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	script</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">onerror</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> error</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;"> =&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">		console</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">error</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">`加载 </span><span style="--shiki-light:#CA1243;--shiki-dark:#569CD6;">${</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">url</span><span style="--shiki-light:#CA1243;--shiki-dark:#569CD6;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> 失败：`</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">error</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">head</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">appendChild</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">export</span><span style="--shiki-light:#E45649;--shiki-dark:#C586C0;"> default</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;"> useLoadScript</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br></div></div></div></details><h4 id="使用" tabindex="-1">使用 <a class="header-anchor" href="#使用" aria-label="Permalink to &quot;使用&quot;">​</a></h4><div class="caution custom-block github-alert"><p class="custom-block-title">注意</p><p></p><p>本地开发出现数字即算成功，部署后会显示正确的数值</p></div><h5 id="script-标签引用使用" tabindex="-1">script 标签引用使用 <a class="header-anchor" href="#script-标签引用使用" aria-label="Permalink to &quot;script 标签引用使用&quot;">​</a></h5><div class="language-html vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">html</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> defer</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> src</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;https://cn.vercount.one/js&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">本文总阅读量 </span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_value_page_pv&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> 次 本站总访问量 </span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_value_site_pv&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> 次</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">本站总访客数 </span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_value_site_uv&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> 人</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h5 id="配置组件插槽使用" tabindex="-1">配置组件插槽使用 <a class="header-anchor" href="#配置组件插槽使用" aria-label="Permalink to &quot;配置组件插槽使用&quot;">​</a></h5><ol><li><p>新建<code>docs/.vitepress/theme/components/Visits.vue</code>文件</p><details class="details custom-block"><summary>点击查看<code>Visits.vue</code>文件内容</summary><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="Visits.vue">Visits.vue</span></div><div class="language-vue vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;visits&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> v-if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">site_uv</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;visits-item&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_container_site_uv&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> style</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">display</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">none</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			本站总访客数 </span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_value_site_uv&quot;</span><span style="--shiki-light:white;--shiki-dark:#F44747;"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> v-if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">site_pv</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;visits-item&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_container_site_pv&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> style</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">display</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">none</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			本站总访问量</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_value_site_pv&quot;</span><span style="--shiki-light:white;--shiki-dark:#F44747;"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> v-if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">page_pv</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;visits-item&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_container_page_pv&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> style</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">display</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">none</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			本文总阅读量</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">span</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vercount_value_page_pv&quot;</span><span style="--shiki-light:white;--shiki-dark:#F44747;"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> setup</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> lang</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;ts&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 访问量统计</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">inBrowser</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">useRoute</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vitepress&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">ref</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">onMounted</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">watch</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vue&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;"> useLoadScript</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;../../../utils/useLoadScript&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;">	site_uv</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> false</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;">	site_pv</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> false</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;">	page_pv</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> false</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">} </span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> defineProps</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">({ </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">site_uv</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> Boolean</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">site_pv</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> Boolean</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">page_pv</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> Boolean</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> route</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> useRoute</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">();</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 忽略名单</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">let</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> ignorePageArr</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> [];</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// 监听路由变化</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">watch</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	() </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> route</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">path</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">to</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">from</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		// 忽略一些页面，不统计访问量（例如[&#39;/config-doc&#39;]就是不统计config-doc文档配置页面）</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">		if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">ignorePageArr</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">some</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">e</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;"> =&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> to</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">indexOf</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">e</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) </span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">!==</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> -</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">1</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">)) {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">			let</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> element</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">getElementById</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;vercount_container_page_pv&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">			if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">element</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">				element</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">style</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">display</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;none&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			}</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">			return</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		}</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		// 加载访问量脚本</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">		if</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">inBrowser</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> &amp;&amp;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> to</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> !==</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> from</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">			useLoadScript</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;https://cn.vercount.one/js&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	},</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">		immediate</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> true</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> lang</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;scss&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.visits</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	/* color: gray; */</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	text-align</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">center</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0.85rem</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">1.25rem</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">	.visits-item</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		margin</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">5px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		font-weight</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">500</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		font-family</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;Segoe UI&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">Tahoma</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, Geneva, </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">Verdana</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">sans-serif</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		// font-family: &#39;Times New Roman&#39;, Times, serif;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		padding</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">2px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 8px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		background-color</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#0184BC;--shiki-dark:#DCDCAA;">var</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">--vp-c-bg-soft</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.visits-home</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	position</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">relative</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	top</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">200px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	z-index</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">99</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.visits-doc</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	margin-top</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">/* 媒体查询小于500 */</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">@media</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> (</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">min-width</span><span style="--shiki-light:#E45649;--shiki-dark:#D4D4D4;">:</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 500px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">	.visits</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		display</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">flex</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		justify-content</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">center</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">	.visits-home</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">		top</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">238px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br></div></div></div></details></li><li><p><code>CustomLayoutSlot.vue</code>文件中配置</p><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="CustomLayoutSlot.vue">CustomLayoutSlot.vue</span></div><div class="language-vue vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Layout</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		&lt;!-- ...其他插槽内容 --&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		&lt;!-- TAG访问量统计（首页） --&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> #</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">home-features-after</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Visits</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;visits-home&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> site_uv</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> site_pv</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;"> /&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		&lt;!-- TAG访问量统计（文档） --&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> #</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">doc-after</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Visits</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;visits-doc&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> page_pv</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;"> /&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">Layout</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> setup</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// ...其他内容</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">// TAG浏览量统计</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;"> Visits</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;./Visits.vue&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br></div></div></div></li></ol><h3 id="umami-现代分析平台" tabindex="-1">Umami 现代分析平台 <a class="header-anchor" href="#umami-现代分析平台" aria-label="Permalink to &quot;Umami 现代分析平台&quot;">​</a></h3><p>地址：<a href="https://umami.is/" target="_blank" rel="noreferrer">https://umami.is/</a></p><p><strong>Umami 是一个网站分析工具，它可以分析出一个网站的详细访问数据，包括请求 PV、UV、国家来源、来源于哪个网站、用户的操作系统、浏览器等等。</strong> 注册账号，添加网站成功后，开启共享 URL，然后将这个 url 放到自己的网站即可。 参考这个链接启用。 <a href="https://umami.is/docs/enable-share-url" target="_blank" rel="noreferrer">https://umami.is/docs/enable-share-url</a></p><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241212172441775.png" alt="image-20241212172441775" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p><h4 id="配置-1" tabindex="-1">配置 <a class="header-anchor" href="#配置-1" aria-label="Permalink to &quot;配置&quot;">​</a></h4><ol><li><p><a href="https://umami.is/" target="_blank" rel="noreferrer">官网</a>注册登录</p></li><li><p>添加要统计的网站站点</p><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241213131321389.png" alt="image-20241213131321389" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p></li><li><p>收集数据，复制生产的 script 地址</p><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241213115205096.png" alt="image-20241213115205096" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="index.ts">index.ts</span></div><div class="language-ts vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">onMounted</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vue&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;"> useLoadScript</span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;"> from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;../../utils/useLoadScript&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">export</span><span style="--shiki-light:#E45649;--shiki-dark:#C586C0;"> default</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	// ...其他内容</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">	setup</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">() {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">		// ...其他内容</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">		onMounted</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(() </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">			// ...其他内容</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">			// 加载脚本umami统计</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">			// 可以配置只在线上生产环境生效process.env.NODE_ENV === &#39;production&#39;</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">			useLoadScript</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;填入上图的src值&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">				&#39;data-website-id&#39;</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;填入上图的data-website-id值&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			});</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		});</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	},</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">};</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br></div></div></div></li><li><p>启用共享 URL</p><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/image-20241213115103553.png" alt="image-20241213115103553" width="auto" height="auto" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p></li><li><p>排除我自己的访问 你想访问自己的网站，但你不希望你的访问出现在你的统计数据。要做到这一点，您需要在浏览器中添加一个设置。</p><p>在浏览器中打开开发者控制台：Settings -&gt; More tools -&gt; Developer tools</p><p>在控制台中，输入以下代码并点击 Enter：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">localStorage</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">setItem</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;umami.disabled&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">1</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>此设置适用于每个网站，因此您需要为每个要排除的网站执行此操作。</p><p>要删除该设置，请输入以下代码并点击 Enter：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">localStorage</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">removeItem</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;umami.disabled&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div></li></ol><h2 id="代码展示效果插件" tabindex="-1">代码展示效果插件 <a class="header-anchor" href="#代码展示效果插件" aria-label="Permalink to &quot;代码展示效果插件&quot;">​</a></h2><p>地址：<a href="https://github.com/zh-lx/vitepress-demo-plugin?tab=readme-ov-file" target="_blank" rel="noreferrer">https://github.com/zh-lx/vitepress-demo-plugin?tab=readme-ov-file</a></p><p>文档：<a href="https://vitepress-demo.fe-dev.cn/guide/start.html" target="_blank" rel="noreferrer">https://vitepress-demo.fe-dev.cn/guide/start.html</a></p><h3 id="安装" tabindex="-1">安装 <a class="header-anchor" href="#安装" aria-label="Permalink to &quot;安装&quot;">​</a></h3><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">pnpm</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> add</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> vitepress-demo-plugin</span><span style="--shiki-light:#986801;--shiki-dark:#569CD6;"> -D</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="配置-2" tabindex="-1">配置 <a class="header-anchor" href="#配置-2" aria-label="Permalink to &quot;配置&quot;">​</a></h3><p><code>docs</code>下 新建 <code>views</code> 文件夹，用来存放要展示代码效果的文件</p><p>在 <code>.vitepress/config.mts</code> 中添加如下代码以引入 <code>vitepressDemoPlugin</code> 插件：</p><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="config.mts">config.mts</span></div><div class="language-ts vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">defineConfig</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vitepress&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">vitepressDemoPlugin</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vitepress-demo-plugin&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">export</span><span style="--shiki-light:#E45649;--shiki-dark:#C586C0;"> default</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> defineConfig</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">({</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">	//...其他内容</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">	markdown</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">		config</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">md</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">) {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">			md</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">use</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">vitepressDemoPlugin</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, {</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-dark:#6A9955;--shiki-light-font-style:italic;--shiki-dark-font-style:inherit;">				// 指定demo文件的地址（也可以不指定，直接写文件路径）</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">				demoDir</span><span style="--shiki-light:#0184BC;--shiki-dark:#9CDCFE;">:</span><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;"> path</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">resolve</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">__dirname</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;../views&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">),</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			});</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">		},</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">	},</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">});</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br></div></div></div><h3 id="使用-1" tabindex="-1">使用 <a class="header-anchor" href="#使用-1" aria-label="Permalink to &quot;使用&quot;">​</a></h3><h4 id="简单展示代码效果" tabindex="-1">简单展示代码效果 <a class="header-anchor" href="#简单展示代码效果" aria-label="Permalink to &quot;简单展示代码效果&quot;">​</a></h4><p>新建 <code>docs/views/Demo1.vue</code>文件</p><details class="details custom-block"><summary>点击查看<code>Demo1.vue</code>文件内容</summary><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="Demo1.vue">Demo1.vue</span></div><div class="language-vue vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;container&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;title&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">Demo1</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;btn-container&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;btn&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> @</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">click</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">increment</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">+1</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;btn&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> @</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">click</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">decrement</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">-1</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">Current count: {{ </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">count</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> }}</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">template</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> setup</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> lang</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;ts&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">ref</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> &#39;vue&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> count</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> ref</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&lt;</span><span style="--shiki-light:#383A42;--shiki-dark:#4EC9B0;">number</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&gt;(</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> increment</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	count</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">value</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">++</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">const</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> decrement</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">	count</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">value</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">--</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">};</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> scoped</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.container</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	font-family</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;PingFang SC&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;Microsoft YaHei&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;SimHei&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;SimSun&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;sans-serif&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">14px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.title</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">24px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	font-weight</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">600</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">32px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.btn-container</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	display</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">flex</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	align-items</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">center</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	column-gap</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">24px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">.btn</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	cursor</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">pointer</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	background-color</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">#007bff</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	color</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">#fff</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	border</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">none</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">14px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	border-radius</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">4px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	padding</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">4px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 16px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">	margin</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">12px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br></div></div></div></details><p>在任意 <code>.md</code> 文件中通过 <code>&lt;demo vue=&quot;xxx/path&quot; /&gt;</code> 指定一个 <code>.vue</code> 文件的路径，渲染该 vue 组件并展示其代码：</p><div class="language-markdown vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">demo</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> vue</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;Demo1.vue&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;"> /&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>其对应的渲染效果如下（可以点击按钮操作）：</p><!----><h4 id="完整展示代码效果" tabindex="-1">完整展示代码效果 <a class="header-anchor" href="#完整展示代码效果" aria-label="Permalink to &quot;完整展示代码效果&quot;">​</a></h4><div class="note custom-block github-alert"><p class="custom-block-title">提醒</p><p></p><p>只能指定 vue、react、html 文件</p><p>vue=&quot;Demo1.vue&quot;</p><p>react=“Demo1.jsx”</p><p>html=&quot;demo.html&quot;</p><p><code>:vueFiles</code>是指定 vue 文件下的其他依赖文件。react 和 html 同理</p><p><code>title</code>和<code>descriptio</code>n 可以再展示效果下方增加标题和描述</p><p><code>order</code>是指定 vue、react、html 文件的显示顺序</p><p><code>select</code>是指定默认选中哪种类型文件</p><p><code>stackblitz</code> 和 <code>codesandbox</code>是可以配置跳转到在线代码编辑平台</p></div><p>再新建 <code>docs/views/demo.html</code>文件、 <code>docs/views/demo.js</code>文件。</p><details class="details custom-block"><summary>点击查看文件内容</summary><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="demo.html">demo.html</span></div><div class="language-html vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">html</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;!</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">DOCTYPE</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> html</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">html</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> lang</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;en&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">head</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">meta</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> charset</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;UTF-8&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;"> /&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">meta</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> name</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;viewport&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> content</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;width=device-width, initial-scale=1.0&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;"> /&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">title</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">Document</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">title</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">head</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">body</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">			.container</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				font-family</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;PingFang SC&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;Microsoft YaHei&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;SimHei&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;SimSun&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;sans-serif&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">14px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">			.title</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">24px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				font-weight</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">600</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">32px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">			.btn-container</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				display</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">flex</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				align-items</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">center</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				column-gap</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">24px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			}</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D7BA7D;">			.btn</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				cursor</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">pointer</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				background-color</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">#007bff</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				color</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#CE9178;">#fff</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				border</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#383A42;--shiki-dark:#CE9178;">none</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				font-size</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">14px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				border-radius</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">4px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				line-height</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">20px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				padding</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">4px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 16px</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">				margin</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">: </span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;">12px</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">style</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;container&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;title&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">Demo1的html类型文件</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;btn-container&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">				&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;btn&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;incrementBtn&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">+1</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">				&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;btn&quot;</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;decrementBtn&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">-1</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">button</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">			&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> id</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;countDisplay&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">Current count: 0</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">div</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;"> type</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;module&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			(</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">function</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">				let</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;"> count</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#986801;--shiki-dark:#B5CEA8;"> 0</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">				const</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> increment</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">					count</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">++</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">					updateCountDisplay</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">();</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">				};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">				const</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> decrement</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">					count</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;">--</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">					updateCountDisplay</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">();</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">				};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">				document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">getElementById</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;incrementBtn&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">).</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">addEventListener</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;click&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">increment</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">				document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">getElementById</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;decrementBtn&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">).</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">addEventListener</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;click&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">decrement</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">				const</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;"> updateCountDisplay</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> () </span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;">=&gt;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#9CDCFE;">					document</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">.</span><span style="--shiki-light:#4078F2;--shiki-dark:#DCDCAA;">getElementById</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;countDisplay&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">).</span><span style="--shiki-light:#E45649;--shiki-dark:#9CDCFE;">innerText</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;"> `Current count: </span><span style="--shiki-light:#CA1243;--shiki-dark:#569CD6;">${</span><span style="--shiki-light:#50A14F;--shiki-dark:#9CDCFE;">count</span><span style="--shiki-light:#CA1243;--shiki-dark:#569CD6;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">`</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">				};</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">			})();</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">		&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">script</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">	&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">body</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;/</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">html</span><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br></div></div></div><div class="vp-code-block-title"><div class="vp-code-block-title-bar"><span class="vp-code-block-title-text" data-title="demo.js">demo.js</span></div><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C586C0;">export</span><span style="--shiki-light:#A626A4;--shiki-dark:#569CD6;"> const</span><span style="--shiki-light:#986801;--shiki-dark:#4FC1FF;"> students</span><span style="--shiki-light:#0184BC;--shiki-dark:#D4D4D4;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> [</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;Amy&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;John&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;Lily&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&#39;Tom&#39;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">];</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div></div></details><div class="language-markdown vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">&lt;</span><span style="--shiki-light:#E45649;--shiki-dark:#569CD6;">demo</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> </span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    vue</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;Demo1.vue&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> </span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    html</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;demo.html&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    :vueFiles</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;[&#39;Demo1.vue&#39;, &#39;demo.js&#39;]&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> </span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    title</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;混合语法 DEMO&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    description</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;这是一个混合 demo 的示例，你可以使用 title 和 description 来指定 demo 的标题和描述&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    order</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;html,vue&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    select</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;vue&quot;</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    stackblitz</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;true&quot;</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;"> </span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#9CDCFE;">    codesandbox</span><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#CE9178;">&quot;true&quot;</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#808080;">/&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><!----><div class="caution custom-block github-alert"><p class="custom-block-title">注意</p><p></p><p>如果是想自定义展示的文件名，可以将</p><div class="language-markdown vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">:vueFiles=&quot;[&#39;Demo1.vue&#39;, &#39;demo.js&#39;]&quot;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>修改为</p><div class="language-markdown vp-adaptive-theme line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes OneLight dark-plus vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">:vueFiles=&quot;{</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&#39;Demo1 文件&#39;: &#39;Demo1.vue&#39;,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">&#39;demo 的 js 文件&#39;: &#39;demo.js&#39;,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#D4D4D4;">}&quot;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></div></div></div></main><footer class="VPDocFooter" data-v-09fc73c3 data-v-a242629a><!--[--><!--[--><!--[--><!--[--><div style="display:none;" class="vitepress-backTop-main" title="返回顶部" data-v-62b2871c><svg t="1720595052079" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4279" width="200" height="200" data-v-62b2871c><path d="M752.736 431.063C757.159 140.575 520.41 8.97 504.518 0.41V0l-0.45 0.205-0.41-0.205v0.41c-15.934 8.56-252.723 140.165-248.259 430.653-48.21 31.457-98.713 87.368-90.685 184.074 8.028 96.666 101.007 160.768 136.601 157.287 35.595-3.482 25.232-30.31 25.232-30.31l12.206-50.095s52.47 80.569 69.304 80.528c15.114-1.23 87-0.123 95.6 0h0.82c8.602-0.123 80.486-1.23 95.6 0 16.794 0 69.305-80.528 69.305-80.528l12.165 50.094s-10.322 26.83 25.272 30.31c35.595 3.482 128.574-60.62 136.602-157.286 8.028-96.665-42.475-152.617-90.685-184.074z m-248.669-4.26c-6.758-0.123-94.781-3.359-102.891-107.192 2.95-98.714 95.97-107.438 102.891-107.93 6.964 0.492 99.943 9.216 102.892 107.93-8.11 103.833-96.174 107.07-102.892 107.192z m-52.019 500.531c0 11.838-9.42 21.382-21.012 21.382a21.217 21.217 0 0 1-21.054-21.34V821.74c0-11.797 9.421-21.382 21.054-21.382 11.591 0 21.012 9.585 21.012 21.382v105.635z m77.333 57.222a21.504 21.504 0 0 1-21.34 21.626 21.504 21.504 0 0 1-21.34-21.626V827.474c0-11.96 9.543-21.668 21.299-21.668 11.796 0 21.38 9.708 21.38 21.668v157.082z m71.147-82.043c0 11.796-9.42 21.34-21.053 21.34a21.217 21.217 0 0 1-21.013-21.34v-75.367c0-11.755 9.421-21.299 21.013-21.299 11.632 0 21.053 9.544 21.053 21.3v75.366z" fill="#FFF" p-id="4280" data-v-62b2871c></path></svg></div><!--]--><!--]--><!--]--><!--]--><div class="edit-info" data-v-a242629a><div class="edit-link" data-v-a242629a><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/dcdy/vitepress-template/edit/main/docs/guide/plugin/util.md" target="_blank" rel="noreferrer" data-v-a242629a><!--[--><span class="vpi-square-pen edit-link-icon" data-v-a242629a></span> 在 GitHub 上编辑此页面<!--]--></a></div><div class="last-updated" data-v-a242629a><p class="VPLastUpdated" data-v-a242629a data-v-6712e2c8>最后更新于: <time datetime="2024-12-20T07:51:02.000Z" data-v-6712e2c8></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-a242629a><span class="visually-hidden" id="doc-footer-aria-label" data-v-a242629a>Pager</span><div class="pager" data-v-a242629a><a class="VPLink link pager-link prev" href="/vitepress-template-public/guide/plugin/style" data-v-a242629a><!--[--><span class="desc" data-v-a242629a>上一页</span><span class="title" data-v-a242629a>样式美化</span><!--]--></a></div><div class="pager" data-v-a242629a><a class="VPLink link pager-link next" href="/vitepress-template-public/guide/github-pages" data-v-a242629a><!--[--><span class="desc" data-v-a242629a>下一页</span><span class="title" data-v-a242629a>Github Pages</span><!--]--></a></div></nav></footer><!--[--><!--[--><!--[--><!----><!--]--><!--]--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-e7ae3156 data-v-34aa0b55><div class="container" data-v-34aa0b55><p class="message" data-v-34aa0b55>基于MIT许可发布</p><p class="copyright" data-v-34aa0b55>版权所有 © 2024 dcdyxmt@163.com</p></div></footer><!--[--><!--]--></div></div>
    
    
  </body>
</html>